/**
 * Created by zhulizhe on 2017/9/4.
 */
import {
    Dimensions,
    PixelRatio,
    Platform,
} from 'react-native';

let designSize = {width:750, height:1336}
let designPixelRatio = 2 ;

const currentSize = Dimensions.get('window') ;

export default class Resolution {
    /** 根据实际屏幕尺寸转换对应的像素宽度 */
    static getWidth(w) {
        return w* currentSize.width / designSize.width;
    }

    static getHeight(h) {
        return h* currentSize.height / designSize.height;

    }

    static px2dp(uiElementPx) {
        return uiElementPx *  designSize.width / currentSize.width;
    }

}

